﻿using System.ComponentModel;

namespace Super.Hmi.Utils.ThemeManager
{
    /// <summary>
    /// 布局设置
    /// </summary>
    public class LayoutSettings : ThemeViewModelBase
    {
        private Layout _layout = new Layout();
        /// <summary>
        /// 布局
        /// </summary>
        public Layout Layout
        {
            get => _layout;
            set => SetProperty(ref _layout, value);
        }
        private ContentLayout _contentLayout = new ContentLayout();
        /// <summary>
        /// 内容布局
        /// </summary>
        public ContentLayout ContentLayout
        {
            get => _contentLayout;
            set => SetProperty(ref _contentLayout, value);
        }
        private LoginLayout _loginLayout = new LoginLayout();
        /// <summary>
        /// 登录布局
        /// </summary>
        public LoginLayout LoginLayout
        {
            get => _loginLayout;
            set => SetProperty(ref _loginLayout, value);
        }
        private Sidebar _sidebar = new Sidebar();
        /// <summary>
        /// 侧边栏
        /// </summary>
        public Sidebar Sidebar
        {
            get => _sidebar;
            set => SetProperty(ref _sidebar, value);
        }
        private TopBar _topBar = new TopBar();
        /// <summary>
        /// 顶栏
        /// </summary>
        public TopBar TopBar
        {
            get => _topBar;
            set => SetProperty(ref _topBar, value);
        }
        private NavigationMenu _navigationMenu = new NavigationMenu();
        /// <summary>
        /// 导航菜单
        /// </summary>
        public NavigationMenu NavigationMenu
        {
            get => _navigationMenu;
            set => SetProperty(ref _navigationMenu, value);
        }
        private Breadcrumb _breadcrumb = new Breadcrumb();
        /// <summary>
        /// 面包屑导航
        /// </summary>
        public Breadcrumb Breadcrumb
        {
            get => _breadcrumb;
            set => SetProperty(ref _breadcrumb, value);
        }
        private Tabs _tabs = new Tabs();
        /// <summary>
        /// 标签栏
        /// </summary>
        public Tabs Tabs
        {
            get => _tabs;
            set => SetProperty(ref _tabs, value);
        }
        private SmallComponents _smallComponents = new SmallComponents();
        /// <summary>
        /// 小部件
        /// </summary>
        public SmallComponents SmallComponents
        {
            get => _smallComponents;
            set => SetProperty(ref _smallComponents, value);
        }
        private BottomBar _bottomBar = new BottomBar();
        /// <summary>
        /// 底栏
        /// </summary>
        public BottomBar BottomBar
        {
            get => _bottomBar;
            set => SetProperty(ref _bottomBar, value);
        }
        private Copyright _copyright = new Copyright();
        /// <summary>
        /// 版权
        /// </summary>
        public Copyright Copyright
        {
            get => _copyright;
            set => SetProperty(ref _copyright, value);
        }
    }

    #region 类型
    /// <summary>
    /// 登录布局
    /// </summary>
    public class LoginLayout : ThemeViewModelBase
    {
        private LoginLayoutType _loginLayoutType = LoginLayoutType.Right;
        /// <summary>
        /// 登录布局
        /// </summary>
        public LoginLayoutType LoginLayoutType
        {
            get { return _loginLayoutType; }
            set { SetProperty<LoginLayoutType>(ref _loginLayoutType, value); }
        }
    }
    /// <summary>
    /// 版权
    /// </summary>
    public class Copyright : ThemeViewModelBase
    {
        private bool _enableCopyright = true;
        /// <summary>
        /// 启用版权
        /// </summary>
        public bool EnableCopyright
        {
            get => _enableCopyright;
            set => SetProperty(ref _enableCopyright, value);
        }
        private string _companyName = "Super Admin";
        /// <summary>
        /// 公司名
        /// </summary>
        public string CompanyName
        {
            get => _companyName;
            set => SetProperty(ref _companyName, value);
        }
        private string _companyHomepage = "https://www.xiaohai.super";
        /// <summary>
        /// 公司主页
        /// </summary>
        public string CompanyHomepage
        {
            get => _companyHomepage;
            set => SetProperty(ref _companyHomepage, value);
        }
        private string _date = "2025";
        /// <summary>
        /// 日期
        /// </summary>
        public string Date
        {
            get => _date;
            set => SetProperty(ref _date, value);
        }
        private string _icpFilingNumber = "20250706";
        /// <summary>
        /// ICP备案号
        /// </summary>
        public string ICPFilingNumber
        {
            get => _icpFilingNumber;
            set => SetProperty(ref _icpFilingNumber, value);
        }
        private string _ipcWebsiteLink = "https://www.xiaohai.super";
        /// <summary>
        /// IPC网站链接
        /// </summary>
        public string IPCWebsiteLink
        {
            get => _ipcWebsiteLink;
            set => SetProperty(ref _ipcWebsiteLink, value);
        }
    }
    /// <summary>
    /// 底栏
    /// </summary>
    public class BottomBar : ThemeViewModelBase
    {
        private bool _enableTheBottomBar = false;
        /// <summary>
        /// 启用底栏
        /// </summary>
        public bool EnableTheBottomBar
        {
            get => _enableTheBottomBar;
            set => SetProperty(ref _enableTheBottomBar, value);
        }
        private bool _theBottomBarIsFixedAtTheBottom = true;
        /// <summary>
        /// 底栏固定在底部
        /// </summary>
        public bool TheBottomBarIsFixedAtTheBottom
        {
            get => _theBottomBarIsFixedAtTheBottom;
            set => SetProperty(ref _theBottomBarIsFixedAtTheBottom, value);
        }
    }
    /// <summary>
    /// 小部件
    /// </summary>
    public class SmallComponents : ThemeViewModelBase
    {
        private bool _enableGlobalSearch = true;
        /// <summary>
        /// 启动全局搜索
        /// </summary>
        public bool EnableGlobalSearch
        {
            get => _enableGlobalSearch;
            set => SetProperty(ref _enableGlobalSearch, value);
        }
        private bool _enableThemeSwitch = true;
        /// <summary>
        /// 启动主题切换
        /// </summary>
        public bool EnableThemeSwitch
        {
            get => _enableThemeSwitch;
            set => SetProperty(ref _enableThemeSwitch, value);
        }
        private bool _enableLanguageSwitching = true;
        /// <summary>
        /// 启用语言切换
        /// </summary>
        public bool EnableLanguageSwitching
        {
            get => _enableLanguageSwitching;
            set => SetProperty(ref _enableLanguageSwitching, value);
        }
        private bool _enableFullScreen = false;
        /// <summary>
        /// 启用全屏
        /// </summary>
        public bool EnableFullScreen
        {
            get => _enableFullScreen;
            set => SetProperty(ref _enableFullScreen, value);
        }
        private bool _enableNotification = true;
        /// <summary>
        /// 启动通知
        /// </summary>
        public bool EnableNotification
        {
            get => _enableNotification;
            set => SetProperty(ref _enableNotification, value);
        }
        private bool _enableLockScreen = true;
        /// <summary>
        /// 启动锁屏
        /// </summary>
        public bool EnableLockScreen
        {
            get => _enableLockScreen;
            set => SetProperty(ref _enableLockScreen, value);
        }
        private bool _enableSidebarSwitch = true;
        /// <summary>
        /// 启动侧边栏切换
        /// </summary>
        public bool EnableSidebarSwitch
        {
            get => _enableSidebarSwitch;
            set => SetProperty(ref _enableSidebarSwitch, value);
        }
        private bool _startRefreshing = true;
        /// <summary>
        /// 启动刷新
        /// </summary>
        public bool StartRefreshing
        {
            get => _startRefreshing;
            set => SetProperty(ref _startRefreshing, value);
        }
        private PreferredLocationSettingsType _preferredLocationSettings = PreferredLocationSettingsType.Automatic;
        /// <summary>
        /// 偏好位置设置
        /// </summary>
        public PreferredLocationSettingsType PreferredLocationSettings
        {
            get => _preferredLocationSettings;
            set => SetProperty(ref _preferredLocationSettings, value);
        }
    }
    /// <summary>
    /// 标签栏
    /// </summary>
    public class Tabs : ThemeViewModelBase
    {
        private bool _enableTabBar = true;
        /// <summary>
        /// 启动标签栏
        /// </summary>
        public bool EnableTabBar
        {
            get => _enableTabBar;
            set => SetProperty(ref _enableTabBar, value);
        }
        private bool _persistentTab = false;
        /// <summary>
        /// 持久化标签页
        /// </summary>
        public bool PersistentTab
        {
            get => _persistentTab;
            set => SetProperty(ref _persistentTab, value);
        }
        private int _maximumNumberOfTagPages = 10;
        /// <summary>
        /// 最大标签页数
        /// </summary>
        public int MaximumNumberOfTagPages
        {
            get => _maximumNumberOfTagPages;
            set => SetProperty(ref _maximumNumberOfTagPages, value);
        }
        private bool _startDragAndDropSorting = false;
        /// <summary>
        /// 启动拖拽排序
        /// </summary>
        public bool StartDragAndDropSorting
        {
            get => _startDragAndDropSorting;
            set => SetProperty(ref _startDragAndDropSorting, value);
        }
        private bool _enableTheCorrespondingVerticalRoller = true;
        /// <summary>
        /// 启用纵向滚轮响应
        /// </summary>
        public bool EnableTheCorrespondingVerticalRoller
        {
            get => _enableTheCorrespondingVerticalRoller;
            set => SetProperty(ref _enableTheCorrespondingVerticalRoller, value);
        }
        private bool _enableTheMiddleMouseButtonToCloseTheTab = false;
        /// <summary>
        /// 启用鼠标中键关闭标签页
        /// </summary>
        public bool EnableTheMiddleMouseButtonToCloseTheTab
        {
            get => _enableTheMiddleMouseButtonToCloseTheTab;
            set => SetProperty(ref _enableTheMiddleMouseButtonToCloseTheTab, value);
        }
        private bool _displayTitleBarIcon = true;
        /// <summary>
        /// 显示标题栏图标
        /// </summary>
        public bool DisplayTitleBarIcon
        {
            get => _displayTitleBarIcon;
            set => SetProperty(ref _displayTitleBarIcon, value);
        }
        private bool _showMoreButtons = true;
        /// <summary>
        /// 显示更多按钮
        /// </summary>
        public bool ShowMoreButtons
        {
            get => _showMoreButtons;
            set => SetProperty(ref _showMoreButtons, value);
        }
        private bool _displayMaximizeButton = false;
        /// <summary>
        /// 显示最大化按钮
        /// </summary>
        public bool DisplayMaximizeButton
        {
            get => _displayMaximizeButton;
            set => SetProperty(ref _displayMaximizeButton, value);
        }
        private bool _displayScrollButtonOrNot = false;
        /// <summary>
        /// 显示滚动按钮
        /// </summary>
        public bool DisplayScrollButtonOrNot
        {
            get => _displayScrollButtonOrNot;
            set => SetProperty(ref _displayScrollButtonOrNot, value);
        }
        private LabelStyleType _labelStyle = LabelStyleType.Simple;
        /// <summary>
        /// 标签风格
        /// </summary>
        public LabelStyleType LabelStyle
        {
            get => _labelStyle;
            set => SetProperty(ref _labelStyle, value);
        }
    }
    /// <summary>
    /// 面包屑导航
    /// </summary>
    public class Breadcrumb : ThemeViewModelBase
    {
        private bool _enableBreadcrumbNavigation = true;
        /// <summary>
        /// 开启面包屑导航
        /// </summary>
        public bool EnableBreadcrumbNavigation
        {
            get => _enableBreadcrumbNavigation;
            set => SetProperty(ref _enableBreadcrumbNavigation, value);
        }
        private bool _hideWhenThereIsOnlyOne = false;
        /// <summary>
        /// 仅有一个时隐藏
        /// </summary>
        public bool HideWhenThereIsOnlyOne
        {
            get => _hideWhenThereIsOnlyOne;
            set => SetProperty(ref _hideWhenThereIsOnlyOne, value);
        }
        private bool _displayBreadcrumbIcon =true;
        /// <summary>
        /// 显示面包屑导航图标
        /// </summary>
        public bool DisplayBreadcrumbIcon
        {
            get => _displayBreadcrumbIcon;
            set => SetProperty(ref _displayBreadcrumbIcon, value);
        }
        private bool _displayHomepageButton = false;
        /// <summary>
        /// 显示首页按钮
        /// </summary>
        public bool DisplayHomepageButton
        {
            get => _displayHomepageButton;
            set => SetProperty(ref _displayHomepageButton, value);
        }
        private BreadcrumbStyleType _breadcrumbStyle = BreadcrumbStyleType.Simple;
        /// <summary>
        /// 面包屑风格
        /// </summary>
        public BreadcrumbStyleType BreadcrumbStyle
        {
            get => _breadcrumbStyle;
            set => SetProperty(ref _breadcrumbStyle, value);
        }
    }
    /// <summary>
    /// 布局
    /// </summary>
    public class Layout : ThemeViewModelBase
    {
        private NavigationPosition _navigationPosition = NavigationPosition.SideVerticalMenu;
        /// <summary>
        /// 布局类型
        /// </summary>
        public NavigationPosition NavigationPosition
        {
            get => _navigationPosition;
            set => SetProperty(ref _navigationPosition, value);
        }

    }
    /// <summary>
    /// 内容布局
    /// </summary>
    public class ContentLayout : ThemeViewModelBase
    {
        private ContentWidthType _content = ContentWidthType.Fluid;
        /// <summary>
        /// 内容布局
        /// </summary>
        public ContentWidthType Content
        {
            get => _content;
            set => SetProperty(ref _content, value);
        }

    }
    /// <summary>
    /// 侧边栏
    /// </summary>
    public class Sidebar : ThemeViewModelBase
    {
        private bool _displaySidebar = true;
        /// <summary>
        /// 显示侧边栏
        /// </summary>
        public bool DisplaySidebar
        {
            get => _displaySidebar;
            set => SetProperty(ref _displaySidebar, value);
        }
        private bool _collapseMenu = false;
        /// <summary>
        /// 折叠菜单
        /// </summary>
        public bool CollapseMenu
        {
            get => _collapseMenu;
            set => SetProperty(ref _collapseMenu, value);
        }
        private bool _hoverTheMouseToExpand = false;
        /// <summary>
        /// 鼠标悬停展开
        /// </summary>
        public bool HoverTheMouseToExpand
        {
            get => _hoverTheMouseToExpand;
            set => SetProperty(ref _hoverTheMouseToExpand, value);
        }
        private bool _foldingDisplayMenuName = false;
        /// <summary>
        /// 折叠显示菜单名
        /// </summary>
        public bool FoldingDisplayMenuName
        {
            get => _foldingDisplayMenuName;
            set => SetProperty(ref _foldingDisplayMenuName, value);
        }
        private bool _automaticallyActivateSubmenus = false;
        /// <summary>
        /// 自动激活子菜单
        /// </summary>
        public bool AutomaticallyActivateSubmenus
        {
            get => _automaticallyActivateSubmenus;
            set => SetProperty(ref _automaticallyActivateSubmenus, value);
        }
        private bool _displayFoldingButton = false;
        /// <summary>
        /// 显示折叠按钮
        /// </summary>
        public bool DisplayFoldingButton
        {
            get => _displayFoldingButton;
            set => SetProperty(ref _displayFoldingButton, value);
        }
        private bool _displayFixedButton = false;
        /// <summary>
        /// 显示固定按钮
        /// </summary>
        public bool DisplayFixedButton
        {
            get => _displayFixedButton;
            set => SetProperty(ref _displayFixedButton, value);
        }
        private double _menuBarWidth = 220d;
        /// <summary>
        /// 菜单宽度
        /// </summary>
        public double MenuBarWidth
        {
            get => _menuBarWidth;
            set => SetProperty(ref _menuBarWidth, value);
        }
    }
    /// <summary>
    /// 顶栏
    /// </summary>
    public class TopBar : ThemeViewModelBase
    {
        private bool _displayTopBar = true;
        /// <summary>
        /// 显示顶栏
        /// </summary>
        public bool DisplayTopBar
        {
            get => _displayTopBar;
            set => SetProperty(ref _displayTopBar, value);
        }
        private TopBarModeType _topBarMode = TopBarModeType.Stationary;
        /// <summary>
        /// 顶栏模式
        /// </summary>
        public TopBarModeType TopBarMode
        {
            get => _topBarMode;
            set => SetProperty(ref _topBarMode, value);
        }
        private MenuPositionType _menuPosition = MenuPositionType.Left;
        /// <summary>
        /// 菜单位置
        /// </summary>
        public MenuPositionType MenuPosition
        {
            get => _menuPosition;
            set => SetProperty(ref _menuPosition, value);
        }
    }
    /// <summary>
    /// 导航菜单
    /// </summary>
    public class NavigationMenu : ThemeViewModelBase
    {
        /// <summary>
        /// 导航菜单风格
        /// </summary>
        private NavigationMenuStyleType _navigationMenuStyle = NavigationMenuStyleType.RoundAndSmooth;
        public NavigationMenuStyleType NavigationMenuStyle
        {
            get => _navigationMenuStyle;
            set => SetProperty(ref _navigationMenuStyle, value);
        }
        /// <summary>
        /// 导航菜单分离
        /// </summary>
        private bool _navigationMenuSeparation = false;
        public bool NavigationMenuSeparation
        {
            get => _navigationMenuSeparation;
            set => SetProperty(ref _navigationMenuSeparation, value);
        }
        /// <summary>
        /// 侧边导航菜单手风琴模式
        /// </summary>
        private bool _sideNavigationAccordionMode = false;
        public bool SideNavigationAccordionMode
        {
            get => _sideNavigationAccordionMode;
            set => SetProperty(ref _sideNavigationAccordionMode, value);
        }
    }
    #endregion

    #region 枚举
    /// <summary>
    /// 登录布局
    /// </summary>
    public enum LoginLayoutType
    {
        Left,
        Right,
        Center
    }
    /// <summary>
    /// 面包屑风格
    /// </summary>
    public enum BreadcrumbStyleType
    {
        [Description("常规")]
        Simple,
        [Description("背景")]
        Background
    }
    /// <summary>
    /// 偏好位置设置
    /// </summary>
    public enum PreferredLocationSettingsType
    {
        [Description("自动")]
        Automatic,
        [Description("顶栏")]
        TopBar,
        [Description("固定")]
        Fixed,
    }
    /// <summary>
    /// 标签风格
    /// </summary>
    public enum LabelStyleType
    {
        [Description("谷歌")]
        Google,
        [Description("朴素")]
        Simple,
        [Description("卡片")]
        Card,
        [Description("轻快")]
        Lively,
    }
    /// <summary>
    /// 导航位置
    /// </summary>
    public enum NavigationPosition
    {
        SideVerticalMenu = 0,   // 侧边垂直菜单
        VerticalDualColumnMenu = 1,    // 垂直双列菜单
        HorizontalMenu = 2,    // 水平菜单
        MixedDualColumnMenu = 3,    // 混合双列菜单
        FullScreenContent = 4,    // 全屏内容
    }
    /// <summary>
    /// 内容宽度类型
    /// </summary>
    public enum ContentWidthType
    {
        Fixed = 0,   // 固定宽度
        Fluid = 1,   // 流式布局
    }
    /// <summary>
    /// 顶栏模式
    /// </summary>
    public enum TopBarModeType
    {
        [Description("静止")]
        Stationary,
        [Description("固定")]
        Fixed,
        [Description("自动隐藏和显示")]
        AutomaticallyHideAndDisplay,
        [Description("滚动隐藏和显示")]
        ScrollToHideAndDisplay
    }
    /// <summary>
    /// 菜单位置
    /// </summary>
    public enum MenuPositionType
    {
        Left,
        Center,
        Right,
    }
    /// <summary>
    /// 导航菜单风格
    /// </summary>
    public enum NavigationMenuStyleType
    {
        [Description("圆润")]
        RoundAndSmooth,
        [Description("朴素")]
        Simple
    }
    #endregion
}
